package com.whp.openapi.dao;

import com.whp.openapi.common.ResponseResult;
import com.whp.openapi.entity.AdminUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AdminUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AdminUser record);

    int insertSelective(AdminUser record);

    AdminUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AdminUser record);

    int updateByPrimaryKey(AdminUser record);
    
    //自定义方法
    AdminUser getUserByEmail(@Param("email") String email);

    List<AdminUser> table(@Param("realName") String realName,
                          @Param("email") String email,
                          @Param("status") Integer status);

    List<Integer> getUserRole(@Param("userId") Integer userId);

    int deleteUserRole(@Param("userId") Integer userId);

    int addUserRole(@Param("userId") Integer userId, @Param("roleIds") Integer[] roleIds);

    int delUsers(Integer[] ids);
}